// pages/setting/setting.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    urlBase: app.globalData.urlBase,
    loginStat: 0,
    disPass: true,
    // canIUse: wx.canIUse('button.open-type.getUserInfo')
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // this.initValidate();
  },
  onShow: function () {
    let userInfo = wx.getStorageSync('storeWxUser');
    // console.log(userInfo);
    let res;
    if (userInfo) {
      if (wx.getStorageSync('isBindedTJ')) {
        res = 2
      } else {
        res = 1
      }
    } else {
      res = 0
    }
    this.setData({
      loginStat: res
    })
  },

  //报错 
  showSubmitInfo(error) {
    wx.showModal({
      content: error.msg,
      showCancel: false,
    })
  },

  wxlogin() {
    wx.navigateTo({
      url: '../account/login/login',
    })
  },

  toLoginPage: function() {
    wx.navigateTo({
      url: '../account/regist/regist',
    })
  },
  
  //前往意见反馈页面
  toFeedBack: function(){
    wx.navigateTo({
      url:'../setting/feedBack/feedBack'
    })
  },
  toMsgNotify: function(){
    wx.navigateTo({
      url: '../setting/msgNotify/msgNotify',
    })
  },
  toInfoManage: function(){
    wx.navigateTo({
      url: '../setting/infoManage/infoManage',
    })
  },
  toAboutUs: function() {
    wx.navigateTo({
      url: '../setting/aboutUs/aboutUs',
    })
  }
})